package com.traffic.service.impl;

import java.util.List;
import com.ruoyi.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.traffic.mapper.PerOvertimeApplicationMapper;
import com.traffic.domain.PerOvertimeApplication;
import com.traffic.service.IPerOvertimeApplicationService;

/**
 * 加班申请Service业务层处理
 * 
 * @author 郭世纪
 * @date 2024-12-08
 */
@Service
public class PerOvertimeApplicationServiceImpl implements IPerOvertimeApplicationService 
{
    @Autowired
    private PerOvertimeApplicationMapper perOvertimeApplicationMapper;

    /**
     * 查询加班申请
     * 
     * @param overtimeId 加班申请主键
     * @return 加班申请
     */
    @Override
    public PerOvertimeApplication selectPerOvertimeApplicationByOvertimeId(Long overtimeId)
    {
        return perOvertimeApplicationMapper.selectPerOvertimeApplicationByOvertimeId(overtimeId);
    }

    /**
     * 查询加班申请列表
     * 
     * @param perOvertimeApplication 加班申请
     * @return 加班申请
     */
    @Override
    public List<PerOvertimeApplication> selectPerOvertimeApplicationList(PerOvertimeApplication perOvertimeApplication)
    {
        return perOvertimeApplicationMapper.selectPerOvertimeApplicationList(perOvertimeApplication);
    }

    /**
     * 新增加班申请
     * 
     * @param perOvertimeApplication 加班申请
     * @return 结果
     */
    @Override
    public int insertPerOvertimeApplication(PerOvertimeApplication perOvertimeApplication)
    {
        return perOvertimeApplicationMapper.insertPerOvertimeApplication(perOvertimeApplication);
    }

    /**
     * 修改加班申请
     * 
     * @param perOvertimeApplication 加班申请
     * @return 结果
     */
    @Override
    public int updatePerOvertimeApplication(PerOvertimeApplication perOvertimeApplication)
    {
        perOvertimeApplication.setUpdateTime(DateUtils.getNowDate());
        return perOvertimeApplicationMapper.updatePerOvertimeApplication(perOvertimeApplication);
    }

    /**
     * 批量删除加班申请
     * 
     * @param overtimeIds 需要删除的加班申请主键
     * @return 结果
     */
    @Override
    public int deletePerOvertimeApplicationByOvertimeIds(Long[] overtimeIds)
    {
        return perOvertimeApplicationMapper.deletePerOvertimeApplicationByOvertimeIds(overtimeIds);
    }

    /**
     * 删除加班申请信息
     * 
     * @param overtimeId 加班申请主键
     * @return 结果
     */
    @Override
    public int deletePerOvertimeApplicationByOvertimeId(Long overtimeId)
    {
        return perOvertimeApplicationMapper.deletePerOvertimeApplicationByOvertimeId(overtimeId);
    }
}
